import socket

IP = '127.0.0.1'
PORT = 8888
address = (IP,PORT)
server = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
server.bind(address)
server.listen(10)
conn,addr=server.accept()
print('accept connections from',addr)
msg = conn.recv(1024)
print(msg.decode('utf8'))
conn.send('已经接收到您的数据{}'.format(msg.decode('utf-8')).encode('utf8'))

conn.close()